package com.area.cth.controller;

import com.area.cth.common.Result;
import com.area.cth.pojo.Goods;
import com.area.cth.service.RecommendationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "推荐相关接口")
@RestController
@RequestMapping("/recommendation")
@CrossOrigin
public class RecommendationController {
    @Autowired
    private RecommendationService recommendationService;

    @Operation(summary = "查询个人商品推荐")
    @GetMapping
    public Result<List<Goods>> recommendationList() {
        List<Goods> goodsList = recommendationService.recommendGoods();
        return Result.success(goodsList);
    }
}
